﻿using System;

namespace BGShell.PowerShell
{
    internal static class SpecialCharacters
    {
        private const char QuoteDoubleLeft = '\x201c';
        private const char QuoteDoubleRight = '\x201d';
        private const char QuoteLowDoubleLeft = '\x201e';
        private const char QuoteReversed = '\x201b';
        private const char QuoteSingleBase = '\x201a';
        private const char QuoteSingleLeft = '\x2018';
        private const char QuoteSingleRight = '\x2019';

        public static bool IsBacktick(char c)
        {
            return c == '`';
        }

        public static bool IsSingleQuote(char c)
        {
            if (c != '\'')
            {
                return (c == QuoteReversed) ||
                    (c == QuoteSingleBase) ||
                    (c == QuoteSingleLeft) ||
                    (c == QuoteSingleRight);
            }

            return true;
        }

        public static bool IsDoubleQuote(char c)
        {
            if (c != '"')
            {
                return 
                    (c == QuoteDoubleLeft) ||
                    (c == QuoteDoubleRight) ||
                    (c == QuoteLowDoubleLeft);
            }

            return true;
        }
    }
}
